package com.learn.jdk;

import java.util.Comparator;
import java.util.function.BinaryOperator;

/**
 * Copyright: Copyright (c) 2019 Asiainfo
 *
 * @ClassName: com.learn.jdk.BinaryOperatorTest
 * @Description: 该类的功能描述
 * @version: v1.0.0
 * @author: lipan
 * @date: 2019/11/9 21:27
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2019/11/9      lipan          v1.0.0               修改原因
 */

public class BinaryOperatorTest {


    public static void main(String[] args) {

        System.out.println(calculator(10, 12, (a, b) -> a + b));

        System.out.println(getMin("abc", "bbc", (str1, str2) -> str1.compareTo(str2)));


    }


    static   int    calculator(int a, int b, BinaryOperator<Integer> bin){

       return   bin.apply(a,b);

    }

    static  String  getMin(String a, String b, Comparator<String> comparator){

        return BinaryOperator.minBy(comparator).apply("abc","bbc");
    }



}


